// **************
// Theme
// **************

#gn-components-theme(@theme-vars) {
    .gn-action-navbar-title {
        .background-color-var(@theme-vars[info]);
        .color-var(@theme-vars[info-contrast]);
    }
    .gn-menu-divider {
        .background-color-var(@theme-vars[primary-contrast]);
    }
    .gn-main-header {
        .background-color-var(@theme-vars[main-bg]);
    }
    .gn-menu {
        .color-var(@theme-vars[main-color]);
        .background-color-var(@theme-vars[main-bg]);
        &.gn-primary {
            .color-var(@theme-vars[primary-contrast]);
            .background-color-var(@theme-vars[primary]);
        }
        &.gn-default {
            .color-var(@theme-vars[main-variant-color]);
            .background-color-var(@theme-vars[main-variant-bg]);
            .gn-menu-divider {
                .background-color-var(@theme-vars[main-border-color]);
            }
        }
        &.gn-default,
        .gn-menu-content-right {
            .btn-default {
                background: transparent;
                border-color: transparent;
                &:hover {
                    .color-var(@theme-vars[main-hover-color]);
                    .background-color-var(@theme-vars[main-hover-bg]);
                }
                &.active {
                    .color-var(@theme-vars[primary-contrast]);
                    .background-color-var(@theme-vars[primary]);
                }
            }
        }
    }
}

// **************
// Layout
// **************

.nav-link {
    display: block;
    padding: 0.25rem 0.5rem;
}

.dropdown-menu .divider {
    margin: 0.5rem 0;
}

.gn-main-header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 150;
}

.gn-main-header-placeholder {
    position: relative;
    width: 100%;
}

nav.hide-navigation#gn-topbar {
    display: none;
}

#gn-topbar {
    position: sticky;
    top: 0;
    z-index: 100;
}

.gn-language-selector {
    .dropdown-menu {
        height: auto;
        max-height: 400px;
        overflow: auto;
    }
    &.inline {
        padding: 0.5rem;
    }
    .btn.active {
        font-weight: bold;
        text-decoration: underline;
    }
}

.gn-menu {
    display: flex;
    width: 100%;
    position: relative;
    padding: 0.5rem 0;
    min-height: 3rem;

    &.gn-default {
        padding: 0.25rem 0;
        font-size: @font-size-sm;
        min-height: 2rem;
        .nav-link {
            font-size: @font-size-sm;
        }
    }

    &.gn-primary {
        padding: 0.25rem 0;
        min-height: 2rem;
    }

    .dropdown-menu li button {
        width: 100%;
        text-align: left;
        padding: 3px 20px;
    }

    &.gn-menu-symmetric {
        .gn-menu-content-left,
        .gn-menu-content-right {
            display: flex;
            flex: 1;
            flex-direction: row;
            min-width: 0;
        }
        .gn-menu-content-right {
            flex-direction: row-reverse;
        }
    }
    .gn-menu-container {
        display: flex;
        flex-direction: row;
        align-items: center;
        margin: auto;
        width: 100%;
    }
    .gn-menu-content {
        display: flex;
        flex-direction: row;
        flex: 1;
        padding: 0 0.3rem;
        align-items: center;
    }

    .gn-menu-content-left {
        display: flex;
        flex: 1;
        flex-direction: row;
        min-width: 0;
        .gn-menu-list {
            > li {
                .dropdown {
                    margin-right: 0.2rem;
                    .btn-sm {
                        padding: 0.313rem 0.5rem;
                    }
                    .caret {
                        margin-left: 0.125rem;
                    }
                }
            }
        }
    }

    .gn-menu-list {
        display: inline-flex;
        align-items: center;
        flex-direction: row;
        list-style-type: none;
        padding: 0;
        margin: 0;
        // li is still visible for injected plugin that return a null component
        // so we need to target the inner component and apply the margin to that element
        > li > * {
            margin-right: 0.4rem;
        }

        img {
            width: auto;
            height: 2.5rem;
        }
    }
    .gn-menu-content-right {
        .gn-menu-list {
            // li is still visible for injected plugin that return a null component
            // so we need to target the inner component and apply the margin to that element
            > li > * {
                margin-right: 0;
                margin-left: 0.4rem;
            }
        }
    }
    .gn-menu-content-side {
        position: relative;
    }
    > .dropdown {
        visibility: hidden;
    }

    .gn-user-menu-dropdown {
        > button {
            padding: 0;
            background-color: transparent;
            border-color: transparent;
            border-radius: 50%;
            img {
                border-radius: 50%;
            }
        }
    }
    .gn-menu-divider {
        width: 1px;
        height: 1.2rem;
    }
    .gn-menu-fill {
        flex: 1;
        display: flex;
        align-items: center;
        .clear-pointer {
            cursor: pointer;
        }
        .resources-found {
            cursor: pointer;
            text-decoration: underline;
        }
        .resources-count {
            padding: 0em 0.2em;
        }
        .resources-count-loading {
            padding: 0em 1em;
            position: relative;
            align-items: center;
            display: inline-flex;
        }
        .badge {
            font-weight: normal;
            background-color: transparent;
        }
    }
}

.gn-filters-menu {
    margin-bottom: 20px;
    position: sticky;
    top: 0px;
    z-index: 10;
}

.gn-action-navbar-title {
    font-weight: 400;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 13rem;
    min-height: 30px;
    margin-right: 0.4rem;
    padding: 0.1rem 0 0.1rem 0.5rem;
    border-radius: 2px;
    font-size: @font-size-sm;

    button.btn {
        background-color: transparent;
        border: none;
        color: inherit;
    }

    i {
        font-size: @font-size-lg;
    }

    div:first-child {
        display: flex;
        align-items: center;
        width: 10rem;
    }
}

.gn-action-navbar-resource-title {
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: default;
}

a.gn-action-navbar-breadcrumb-link {
    padding: 0;
    color: inherit;

    &:hover {
        color: inherit;
    }
}

.gn-action-navbar-breadcrumb-seperator {
    margin: 0 0.5rem;
}

.gn-language-selector {
    margin-left: 0.4rem;
}

.gn-content-responsive {
    span:last-child:not(span:first-of-type) {
        display: none;
    }
}

@media screen and (max-width: 485px) {
.gn-content-responsive {
    span:first-of-type {
        display: none;
    }
    span:last-child:not(span:first-of-type) {
            display: unset;
    }
    }
}

@media (max-width: 748px) {
    #gn-brand-navbar-bottom.hide-search-bar {
        display: none;
    }
}
